home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 4
/
Merciful - Disc 4.iso
/
software
/
p
/
psychotoads.dms
/
psychotoads.adf
/
a12
< prev
next >
Wrap
Text File
|
1989-03-31
|
33KB
|
791 lines
10.7.1990
IMAGE PROUDLY PRESENTS ANOTHER STUNNING RELEASE:
AAAA MMMM MMMM OOOOOOOO SSSSSS
AAAAAA MMMMMM MMMMMM OOOO OOOO SSSS SSSS
AAAAAAAA MMMMMMMMMMMMMMM OOOO OOOO SSSS SSS
AAAA AAAA MMMM MMMMM MMMM OOOO OOOO SSSSSSS
---- ---- ---- - ---- ---- ---- ------
-------------- ---- ---- ---- ---- ---- ----
AAAA AAAA MMMM MMMM OOOOOOOO SSSSSSSSS
T H E C R E A T O R
Thanx to Mr.Spaghetto/Accession for the typin' work!
(Using CygnusEd Professional Release II)
Without the great help of
Stranger/Image
you woudn't have this File/Print in your hands. He delivered me
the original manual, and promised to spread the Final Version of
this file all around the world.
-- Try the NO.1 BBS in Finland, give a call to IMAGE HQ --
-- Pirates Cove at: +358-0-802 4389 (HST DS, 121MB, 24H)--
How was it all done?
====================
AMOS Basic was designed and progrqammed by François Lionet. His clever
ideas and inspirational work have produced what we feel to be by far
the best high-level programming language available on the amiga to
date.
AMOS was developed using the following programs:
DEVPAC II Assembler - HiSoft
Deluxe Paint III - Electronic Arts
Pix Mate - Progressive Peripherals & Software
Cross-Dos - Consultron
Mini Office Professional Communications - Database Software
Mandarin Software would like to thank the following people for their
kind help during the development of AMOS:
Allistair Brimble, Aaron and Adam Fothergill of Shadow Software, Peter
Hickman, Rico Holmes, Commodre UK for the international keyboard
layouts (an the Amiga), Commodore France for the help with the A1000
problem, 17-Bit Software for samples and demos, Martyn Brown for fonts
and support, Virus Free PD for Soundtracker, Simon Cook for his
constructive comments and bugfinding, Lee, Alex, all other AMOS
developers for their kind help and all of you who have waited patienly
for this software. We hope, like us, you feel it was well worth the
wait.
This manual (the original , not this ASCII file) was written using
WriteNow on the Apple Macintosh and paged up with Page Maker.
Copyright Notice
================
Amos will enable you to create some very impressive software. It is
very important that you acknowledge AMOS in your programs using a
phrase such as "Written by John Smith using AMOS", and, where possible,
include the AMOS Sprite.
If your program is released commercially, the words
" AMOS © 1990 Mandarin/Jawx " must be included on the back of the
packaging and in the printer instructions.
CONTENTS
------------------------------
1: INTRODUCTION
Dedication ..................................... 2
Foreword ....................................... 2
2: GETTING STARTED
Backup AMOS now ................................ 3
Installing AMOS on a single floppy system ...... 3
Installing AMOS on a double floppy system ...... 4
Installing AMOS onto a hard disc ............... 4
Loading AMOS Basic ............................. 4
AMOS tutorial .................................. 5
Loading a program ............................ 5
Deleting a program ........................... 6
Direct mode .................................. 6
Animation! ................................... 7
Listing the sprite files ..................... 7
Loading a sprite file ........................ 7
Setting the sprite colours ................... 8
Displaying a sprite .......................... 8
Animating a sprite ........................... 8
Moving a sprite .............................. 8
Music maestro! ............................... 9
The journey continues .......................... 9
Hints and tips ................................. 9
3: THE EDITOR
The menu window ................................ 11
The information line ........................... 11
The editor window .............................. 12
An introduction to direct mode ................. 13
Loading a program .............................. 14
The AMOS file selector ......................... 14
Saving a Basic program ......................... 15
Scrolling thourgh your files ................... 15
Changing the current drive ..................... 15
Changing the directory ......................... 15
Setting the search path ........................ 15
Using the file selector ........................ 16
Editor tutorial ................................ 16
Scrolling through a listing .................. 16
Label/Procedure searches ..................... 17
Folding a procedure definition ............... 18
Search/Replace ............................... 18
Finding an item .............................. 18
Replace ...................................... 18
Cut and Paste ................................ 19
Multiple programs and accessories ............ 19
Multiple programs .......................... 19
Accessories ................................ 20
Direct Mode .................................... 21
Direct mode editor keys ...................... 21
The menu window ................................ 22
Default menu ................................. 22
The system menu .............................. 24
The blocks menu .............................. 25
The search menu .............................. 26
Keyboard macros ................................ 28
Conserving memory .............................. 30
Inside accessories ............................. 30
The HELP accessory ............................. 32
The editor control keys ........................ 32
Special keys ................................. 33
Editing keys ................................. 33
The cursor arrows ............................ 33
Program control .............................. 33
Cut and Paste ................................ 34
Marks ........................................ 34
Search/Replace ............................... 34
Tabs ......................................... 34
4: BASIC PRINCIPLES
Variables ...................................... 35
Types of variables ............................. 35
Integers ..................................... 35
Real numbers ................................. 36
String variables ............................. 36
Giving a variable a value ...................... 36
Arrays ......................................... 36
Constants ...................................... 37
Arithmetic operations .......................... 38
String operations .............................. 40
Parameters ..................................... 41
Line numbers and labels ........................ 41
Labels ....................................... 41
Procedures ..................................... 42
Local and global variables ................... 43
Parameters and procedures .................... 44
Shared variables ............................. 45
Returning values from a procedure ............ 46
Leaving a procedure .......................... 47
Local DATA statements ........................ 47
Hints and tips ............................... 47
Memory Banks ................................... 48
Types of memory bank ......................... 48
Deleting banks ............................... 50
Bank parameter functions ..................... 50
Loading and saving banks ..................... 51
Memory fragmentation ........................... 52
Finding space for your variables ............... 53
5: STRING FUNCTIONS
Array operations ............................... 59
6: GRAPHICS
Colour ......................................... 61
Line drawing commands .......................... 63
Line types ................................... 67
Filled shapes .................................. 67
Fill types ................................... 68
Writing styles ............................... 70
Advanced techniques .......................... 71
7: CONTROL STRUCTURES
Jumps, Tests etc.................................73
Error handling ................................. 83
8: TEXT & WINDOWS
Text attributes ................................ 87
Cursor functions ............................... 89
Conversion functions ........................... 91
Cursor commands ................................ 92
Text input/output .............................. 96
Advanced text commands ......................... 98
Windows ........................................ 99
Slider bars .................................... 104
Fonts .......................................... 105
Graphic text ................................. 105
Installing new fonts ......................... 109
Trouble shooting ............................. 109
9: MATHS COMMANDS
Trigonometric functions ........................ 111
Standard mathematical functions ................ 114
Creating random sequences ...................... 115
Manupulating numbers ........................... 116
10: SCREENS
The default screen ............................. 119
Defining a screen .............................. 119
Special screen modes ........................... 121
Extra half-bright mode (EHB) ................... 122
Hold and modigy mode (HAM) ..................... 122
Loading a screen ............................... 124
Saving a screen ................................ 124
Moving a screen ................................ 125
Screen control commands ........................ 127
Defining the screen colours .................... 131
Clearing the screen ............................ 131
Manupulating the contents of a screen .......... 132
Scrolling the screen ........................... 133
Screen switching ............................... 134
Screen Synchronization ......................... 136
Special effects ................................ 136
Changing the copper list ....................... 142
Hints and tips ................................. 144
11: HARDWARE SPRITES
The sprite commands ............................ 145
Computed sprites ............................... 146
Creating an individual hardware sprite ......... 149
The sprite palette ............................. 150
Controlling sprites ............................ 151
Conversion functions ........................... 153
12: BLITTER OBJECTS
The bob control commands ....................... 161
13: OBJECT CONTROL
The mouse pointer .............................. 165
Reading the joystick ........................... 167
Deleting collisions ............................ 169
with a sprite ................................ 169
with a bob ................................... 170
between sprites and bobs ..................... 170
with retangular blocks ....................... 172
Bob priority ................................... 174
Miscellaneous commands ......................... 175
14: AMAL
AMAL principles ................................ 176
AMAL tutorial .................................. 177
Moving an object ............................. 177
Animation .................................... 179
Simple loops ................................. 180
Variables and expressions .................... 181
Internal registers ......................... 181
External registers ......................... 181
Special registers .......................... 182
Operators .................................. 182
Making decisions ............................. 183
Generating an attack wave for a game ......... 184
Recording a complex movement sequence ........ 185
AMAL commands .................................. 187
AMAL functions ................................. 191
Controlling AMAL programs from Basic ........... 193
AMAL errors .................................... 195
Error messages ............................... 196
Animation channels ............................. 197
Animating a computed sprite .................. 197
Animating a bob .............................. 197
Moving a screen .............................. 198
Hardware scrolling ........................... 198
Changing the screen size ..................... 199
Rainbows ..................................... 199
Advancee techniques ............................ 199
The Autotest system .......................... 199
Autotest commands ............................ 200
Inside Autotest .............................. 201
Timing considerations .......................... 201
Beating the 16 object limit .................... 202
STOS compatible animation commands ............. 202
15: BACKGROUND GRAPHICS
Icons .......................................... 207
Screen blocks .................................. 209
16: MENUS
Using a menu ................................... 212
Creating a simple menu ......................... 212
Setting the title line ....................... 212
Reading a simple menu ........................ 214
Advanced menues features ....................... 214
The menu hierarchy ........................... 215
Keyboard shortcuts ........................... 219
Menu control commands ........................ 220
Embedded menu commands ......................... 222
Alternative menu styles ........................ 227
Moveable menus ................................. 229
Moving a menu within a program ............... 231
Displaying a menu at the cursor position ..... 232
17: SOUND AND MUSIC
Simple sound effects ........................... 233
Sound channels ................................. 234
Sampled sound .................................. 235
Creating a sample bank ....................... 237
Music .......................................... 238
Playing a note ............................... 240
Waveforms and envelopes ...................... 241
Speech ......................................... 246
Filter effects ................................. 248
18: THE KEYBOARD
Input/Output ................................... 252
19: OTHER COMMANDS ............................... 254
20: DISC ACCESS
Drives and volumes ............................. 260
Drives ....................................... 260
Volumes ...................................... 260
Logical devices .............................. 261
Cross Dos .................................... 261
Dir changing ................................... 262
Common disc operations ......................... 265
Selecting a file ............................... 266
Running an AMOS program from disc .............. 266
Checking for the existence of a file ........... 267
Disc files ..................................... 268
Sequential files ............................. 268
Random access files .......................... 271
The printer .................................... 274
External devices ............................... 274
21: SCREEN COMPACTION ............................ 276
22: MACIHNE LEVEL INSTRUCTIONS
Number conversion .............................. 279
Memory manipulation ............................ 279
Bitwise operations ............................. 282
Using assembly language ........................ 285
Accessing the system libraries ................. 287
Inside AMOS Basic .............................. 288
23: COMMAND INDEX ................................ 289
1: INTRODUCTION 1
-----------------------------
WELCOME to the exciting world of AMOS - The Creator! As you know, the
Amiga is a truly amazing computer. For the first time, all that power
is at your fingertips.
In Septemper 1988, Mandarin Software released STOS Basic for ST. This
made history as the first programming language to reach number one in
the ST Gallup games charts! Now STOS has been rewritten from the gound
up to produce AMOS Basic for the Amiga. AMOS Basic includes a vast
range of over 500 commands - many of which are staggeringly powerful.
You can, for instance, bounce a screen, or animate a sprite using just
a single Basic instruction.
AMOS is not just another version of Basic - it's a dedicated games
creation system which comes with its own built-in Animation Language
(AMAL). AMAL programs are executed 50 times a second using a powerful
interrupt system. They can be used to generate anything from the attack
waves in an arcade game, to a silky-smooth hardware scrolling efect. At
the same time, your Basic program can be doing something completely
different!
Whatever you knowledge of programming, AMOS has something to offer
you. If you have newer written a game before, the prospect of creating
your first game may be quite daunting. But do bear in mind that many of
the all-time classics are uncomplicated programs with one or two
original features - just look at Tetris for example. The strength of
your game will depend on the quality of your ideas, and not just your
programming skill. With a little help from AMOS, you'll be able to
produce professional-looking games with just a fraction of the normal
effort. All you really need is imagination.
If you've written a game in AMOS basic, don't keep it to yourself.
Mandarin Software is very keen to publish any program written using
AMOS. Don't worry if your programming is a little rough. If your ideas
are good enough, you could have a real future as a professional games
writer. So please send us your programs. Mandarin would also be
delighted to hear your comments or suggestions for the AMOS system.
Several features in AMOS were taken directly from the ideas which were
sent to us from existing STOS users. Address your correspondence for
the attention of Richard Vanner, Development Manager, Mandarin
Software, Adlington Park, Adlington, Macclesfield SK10 4NP.
2: GETTING STARTED 3
-----------------------------
AMOS Basic is a truly remarkable package, capable of creating games
which were previously beyond your wildest dreams. All this powerful
features which make the Amiga so irresistible have been incorporated
into this amazing system. With help of AMOS Basic you can develop
programs which would tax the skills of even the most expert assembly
language programmer.
You can for instance, effortlessly animate up to 56 hardware sprites
simultaneously! This is a real achievement, especially when you
consider that the Amiga's hardware only actually provides you with
eight.
If you need even more action on the screen, you can use the Amiga's
blitter chip as well. Blitter objects can be created in any graphics
mode you like, including HAM! The only limit to the number of bobs on
the screen is the amount of available memory.
Any combination of the Amiga's graphics modes can be displayed on the
screen at once. Hardware scrolling isn't jsut possible, it's easy!
There's a built-in SCREEN OFFSET command which allows you to perform
the entire process directly.
In fact, the only hard part of AMOS Basic is knowing where to start!
AMOS supports over 500 Basic commands, and if you're never used Basic
before, you may feel a little overawed by the sheer scale of this
system. When you're in unfamiliar territory, it's always useful to have
a *GUIDE* (Thanks to me!, Mr.Spaghetto ;-) to show you around and point
out some of the notable landmarks. That's the purpose of this chapter.
Backup AMOS *now* !
===================
Before continuing however, it's vital that you back up the entire AMOS
Basic package on fresh discs. This will safeguard your copy of AMOS
against accidental mistakes. You'll now be able to play around with the
system as much as you like, without the risk of destroying something
important.
If the worst comes to the worst, we at Mandarin will be happy to
replace your disc for a nominal handing charge. But you'll obviously be
deprived of AMOS Basic while it's being re-duplicated.
The installation procedure varies depending on your precies set-up,
but it can usually be accomplished in a matter of minutes.
How to backup?
--------------
If you have got this Ascii file into your hands, you propably also
have some cool copy-prog, for example; X-Copy, D-Copy or other...
Place the originals into a safe place and use the fresh copies now.
Loading AMOS Basic 4
==================
As you might expect, AMOS Basic can be executed in a variety of
different ways. You can, for instance, load AMOS directly from the
Workbench by selecting its icon with the left mouse button. Once you've
entered AMOS in this way, you will be able to flick back and foth to
the Workbench by pressing the Amiga and A keys from the keyboard.
In practive however, the Workbench consumes valuable memory which
would be better used to hold your Basic programs. So if you're a
serious user, you'll propably prefer to boot up AMOS as part of your
normal start-up sequence. This will allow you to achieve the maximum
possible results from the AMOS system.
To load AMOS Basic:
* Turn off your Amiga and wait for about ten secs.
* Place a backup of the AMOS program disc (disc 1) into DF0:
* Now switch on your Amiga. AMOS will load into memory
automatically.
* Hit a key to remove the information box and thus enter the
AMOS system.
AMOS tutorial 5
=============
The first thing you'll see when you enter AMOS Basic is the editor
window. This is extremely easy to use, and if you've a little previous
experience with computers it should be self-explanatory. Feel free to
experiment as much as you like. The AMOS editor is quite intelligent,
and you are unlikely to make any serious mistakes.
Now you've seen the editor window, It's time to explore some of the
features that make AMOS Basic really stand out from the crowd.
Loading a program
-----------------
We'll start off by showing you how you can load one of the terrific
games from the AMOS data disc. We'll take the Number Leap game as an
example:
* Insert the AMOS_DATA disc into drive DF0:
* Hold down an Amiga key on the keyboard and press "L". This will
bring up a standard file selector on the screen.
* Click on the disc drice label DF0 to inform AMOS that you have
changed the disc.
* At the centre of the file selector there will be a list of
programs which can be loaded into AMOS Basic.
* To select the Number Leap program, just position the mouse pointer
over the file:
Number_Leap.AMOS
The file you have chosen will be highlighted accordingly.
* Once you've chosen your file, you can load it by clicking twice
on the left mouse button. Your game will now be entered from the
AMOS DATA disc and you will be returned to the original editor
screen. The contents of this window will be updated to display
your new program listing.
* You can run this program by selecting the RUN button from the main
menu area (or hit F1 if you're feeling lazy).
The editor screen will now disappear completely and Number_Leap will
be executed in front of your eyes. After you've played with this game
to your satisfaction, you can exit to AMOS Basic by pressing the CTRL
and C simultaneously.
CTRL+C provides an effective way of breaking into the vast majority
of AMOS programs. It can be disabled from within your program using a
BREAK OFF command for extra security. When the program has been broken
into yu can flick straight back to the editor by pressing the Spacebar
key from the keyboard.
Deleting a program 6
------------------
Now that we've finished with the Number Leap program, we can erase it
from memory with the NEW command. You won't find this option on the
main menu, as it's been placed in a separate SYSTEM menu. This can be
brought into view by moving the mouse pointer over the menu window and
holding down the right mouse button.
To delete a program:
* Ensure the mouse pointer is over is over the menu area.
* Hold the Right mouse button down to bring up the SYSTEM menu.
* While the button is depressed, move the pointer over the NEW option
and select it with the Left mouse key. Alternatively, you can
execute this option directly from the keyboard by pressing
Shift+F9.
* Type Y to confirm the operation or N to abort.
* If the current program hasn't been saved, you'll been asked whether
to store it onto the disc. If you select the YES option, you'll
be presented with an AMOS file selector. Otherwise your program
will be totally erased.
Direct mode
===========
We'll now have a quick look at the direct mode. This forms the centre
of the AMOS Basic package and allows you to experiment with your
routines and immediately observe the effects.
It's important to recognize that all the screens, sprites, and music
defined in your program are completely separate from the Editor window.
So no matter what you do in direct mode, you'll be able to return to
your listing with just a single keypress.
* Enter direct mode by pressing ESCape. The editor window will slide
away and you'll be presented with the main program display.
Towards the bottom of this area will be a small screen which can be
used to enter your direct mode commands. Try typing the following line,
pressing Return to "execute".
Print "Your name"
Insert your name between the quotes to print your names on the Amiga's
screen. Now press the UP and DOWN arrows from the keyboard to move the
window around the display area. As you can see, the Direct mode window
is totally independent of the main program screen.
Animation! 7
==========
So much for the Direct mode. Let's experiment with some of the AMOS
Basic sprite instructions. Before we can use these commands, we'll need
to load a set of sprite images into memory. Stay in direct mode and
enter the indented lines in bold as you come to them.
Listing the sprite files
------------------------
We'll begin by listing all the available sprite files to the Amiga's
screen.
* Ensure that the AMOS DATA disc is still in the DF0:
* Display the disc file directory with the line:
Dir "AMOS_DATA:Sprites/"
This will display the sprite files we've supplied on the AMOS data
disc. These files contain all the images which are used in the various
example programs. You can create your own images using the Sprite
definer accessory on the AMOS Program disc.
The sprite definer incorporates a host of powerful drawing features
which make it extremely easy to generate professional-quality animation
sequences in your games.
Loading a sprite file
---------------------
We can now load these sprites using the LOAD command. The sprites will
load into a special memory bank so don't except to see any sprites to
appear yet! Let's enter the sprites used by the Number Leap game with
the following command:
Load "AMOS_DATA:Sprites/Frog_Sprites.abk"
If you make a mistake, hit F1 to get your previous line. This line can
be then edited using the normal cursor keys and may be re-executed by
pressing Return.
Now let's also load up a music file using a similar load command:
Load "AMOS_DATA_Sprites/Funkey.abk"
In order to check whether the sprites and music have been succesfully
loaded into memory, we'll call up the LISTBANK instruction like so:
Listbank
This prints a line like:
1 - Sprites S:$0682B0 L:000040
3 - Music S:$043878 L:0081FE
Don't worry if the numbers do not correspond as they will change
depending on the available memory. The number of sprites we've just
loaded can be returned directly with the LENGTH function.
Print Length(1)
( result: 64 )
Setting the sprite colours 8
--------------------------
Each set of sprite images has its own set of colour values stored on
the disc. Since these can be very different from your current screen
colours, it's useful to be able to GRAB the colours from the sprite
bank and copy them into an existing screen. This can be accomplished
with the GET SPRITE PALETTE command. Enter the line:
Get Sprite Palette
All the colours in the main program screen will change immediately, but
the direct mode window will be completely unaffected because it's been
assigned its own separate list of colour values by the AMOS system.
Displaying a sprite
-------------------
Sprites can be displayed anywhere on the screen using a simple AMOS
Basic sprite command. Here's an example:
Sprite 8,129,50,62
Animating a sprite
------------------
Let's animate this object using The "AMos Animation Language". AMAL is
a unique animation system which can be used to move or animate your
objects at incredible speed.
Note that when you're entering the following example programs, it's
essential to type each line *exactly* as its appreas in the listing, as
otherwise you may get an unexpected syntax error.
Sprite 8,129,150,62
Amal 8,"Anim 0,(62,5)(63,5)(64,5);" : Amal On
The program above animates a small duck on the screen. Whilst it's
being manupulated, the sprite cn be moved around using the SPRITE
command. Example:
Sprite 8,300,50,
Moving a sprite
---------------
Now for some movement!
Sprite 8,129,150,62 : A$="Anim 0,(62,5)(63,5)(64,5);"
A$=A$+"Loop: Move 320,0,100; Move -320,0,100; Jump Loop"
Amal 8,A$ : Amal On
This programs animates the duck and moves it back and forth across the
screen, using just three lines!
Although the instructions between the quotes may look like Basic,
they're actually written in AMAL. All AMAL programs are executed 50
times a second and they can be exploited to produce silky smooth
animation effects independently of your Basic programs.
Just to prove how amazing AMAL really is, hit ESC to jump back to the
Basic editor. After a few moments, return to direct mode. Your sprite
will still be bouncing accross the screen as if nothing had happened!
Music maestro! 9
--------------
For a finale, let's play the music! Ensure you're still in direct mode,
turn up the volume on your monitor and start the music running the
MUSIC command like so:
Music 1
By the way, you can stop the music with the command:
Music Off
The joyrney continues
=====================
Hopefully, you'll now have a pretty good idea of what AMOS Basic can
achieve. But so fat we've only looked at a tiny fraction of AMOS
Basic's power. As you experiment with the AMOS package, you'll quickly
discover a whole new world, full of exciting possibilities.
AMOS Basic can't, of course, transform you into an expert games
programmer overnight. Like any programming language, it does take a
little time to familiarise yourself with the entire repertoire of
commands. We'll therefore end this section with a few guidelines to
help you on your way.
Hints and tips
--------------
* The best way to learn about AMOS is to create small programs to
animate sprites, scroll screens or generate hi-score tables. Once
you've created a little confidence, you'll then be able to incorporate
these routines into an actual game.
* Don't be overawed by the sheer size of the AMOS Basic language. In
practive, you can achieve terrific effects with only a tiny
fraction of the 500 or so commands available from AMOS. Start by
mastering just a couple of instructions such as SPRITE and BOB, and
then work slowly through the various sections. As you progress, you'll
gradually build-up a detailed knowledge of the AMOS system.
* Although we've attempted to make this package as easy to use as
possible, a thorough groundging of the general principles of Basic
programming is invaluable. If you're new to Basic, you may find it
helpful to purchase an introductory text such as "Alcock's Illustrating
Basic. (Cambridge University Press.)
* Plan your games carefully on paper. It's amazing how many problems 10
can be completely avoided at the early design stages. Never attempt
to tackle really large projects without prior preparation. It's the
easiest way to get permanently lost.
* When you're writing a game, try to concentrate on the quality of
the game play rather than the special effects. The graphics and
music can always be added later if the idea's are good enough.